package app.utils.wechat;

public class JsApiTicket {
	private String url;
	private String timestamp;
	private long upto;
	private String nonce;
	private String signature;
	private String ticket;
	public JsApiTicket(String url,String ticket,String timestamp, String nonce, String signature,int expires_in) {
		this.url=url;
		this.ticket=ticket;
		this.timestamp = timestamp;
		this.nonce = nonce;
		this.signature = signature;
		this.upto=Long.valueOf(timestamp)+expires_in;
	}
	public String getTimestamp() {
		return timestamp;
	}
	public String getTicket() {
		return ticket;
	}
	public void setTicket(String ticket) {
		this.ticket = ticket;
	}
	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}
	public String getNonce() {
		return nonce;
	}
	public void setNonce(String nonce) {
		this.nonce = nonce;
	}
	public String getSignature() {
		return signature;
	}
	public void setSignature(String signature) {
		this.signature = signature;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public boolean isUpto() {
		return upto<System.currentTimeMillis()/1000;
	}
	public boolean isUrlChang(String url) {
		return !this.url.equals(url);
	}
}
